import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'check_out/check_out_item.dart';
import '../widget/dash_line.dart';
import 'order_detail/order_detail_status.dart';
class OrderDetail extends StatefulWidget {
  @override
  _OrderDetailState createState() => _OrderDetailState();
}

class _OrderDetailState extends State<OrderDetail> {



  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.red,
        leading: BackButton(color: Colors.white,),
        centerTitle: true,
        title: Text('订单详情',
          style: TextStyle(
              color: Colors.white,
              fontSize: 30.sp,
              fontWeight: FontWeight.bold),),
      ),
      body: ListView(
        physics: BouncingScrollPhysics(),
        children: [
          Container(
            alignment: Alignment.center,
            height:150.w,
            decoration: BoxDecoration(
              color: Colors.red
            ),
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Container(
                  margin:EdgeInsets.only(left: 50.w,right: 50.w),
                  width: 65.w,
                  child: Stack(
                    children: [
                      CircularProgressIndicator(
                        backgroundColor: Colors.red,
                        valueColor: new AlwaysStoppedAnimation<Color>(Colors.white),
                      ),
                      Positioned(
                        left:10.w,
                        top:10.w,
                        child: Icon(Icons.face,color: Colors.white,),
                      )
                    ],
                  ),
                ),
                Expanded(
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text('请在07-16 16:32:54前完成支付!',style: TextStyle(
                          color: Colors.white,
                          fontSize: 35.sp
                      ),),
                      Text('2020-07-15 15:32:54',style: TextStyle(
                          color: Colors.white,
                          fontSize: 25.sp
                      ),)
                    ],
                  ),
                )

              ],
            ),
          ),

      Container(
        width: double.infinity,
        height:100.w,
        margin: EdgeInsets.only(top: 30.w),
        child: OrderDetailStatus(),
      ),
          Container(
            child: ListTile(
              title: Text('王志强 18860474919'),
              subtitle: Text('合肥市 王圩村 安徽 发的说法啊'),
            ),
          ),
          Container(
            width: 700.w,
            child: DashLine(),
          ),
          Container(
            alignment: Alignment.centerLeft,
            color: Colors.white,
            height: 100.w,
            padding:EdgeInsets.symmetric(horizontal: 25.w, vertical: 25.w),
            child: Text('共2件商品'),
          ),
          Container(
            color: Colors.white,
            padding: EdgeInsets.all(20.w),
            child: Column(children: [
              Column(
                children: <Widget>[
                  CheckOutItem(),
                  Divider(),
                  CheckOutItem(),
                  Divider(),
                ],
              )
            ]),
          ),
          Container(
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Icon(Icons.message,color: Colors.red,size: 40.sp,),
                SizedBox(width: 15.w,),
                Text('联系客服',style: TextStyle(
                  color: Colors.red,
                  fontSize: 32.sp
                ),)
              ],
            ),
          ),
          ListTile(
            dense:true,
            title: Text('订单编号'),
            trailing: Row(
              mainAxisSize: MainAxisSize.min,
              children: [
                Text('wx03423423402152314234125234'),
                SizedBox(width: 10.w,),
                Container(
                  width: 90.w,
                  child: RawMaterialButton(
                    onPressed: (){},
                    child: Text('复制',style: TextStyle(
                      fontSize: 9
                    ),),
                  ),
                )
              ],
            ),
          ),
          ListTile(
            dense:true,
            title: Text('下单时间'),
            trailing: Text('2020-5205-2202-21-12-2'),
          ),
          ListTile(
            dense:true,
            title: Text('支付状态'),
            trailing: Text('300.00'),
          ),
          ListTile(
            dense:true,
            title: Text('支付方式'),
            trailing: Text('微信支付'),
          ),
          ListTile(
            dense:true,
            title: Text('卖家留言'),
            trailing: Text('2114941860'),
          ),
          Container(
            width: 700.w,
            margin: EdgeInsets.symmetric(horizontal: 25.w),
            alignment: Alignment.centerRight,
            child: FlatButton(
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(25))
              ),
              onPressed: (){},
              color: Colors.red,
              child: Text('立即付款',style: TextStyle(
                color: Colors.white
              ),),
            ),
          )

        ],
      ),
    );
  }
}
